Timeplot

From Documentation

Icon info.png Note: The content of this page has been deprecated/removed in the latest version.

Timeplot

Deprecated, please use ZK Charts instead

Employment/Purpose

Timeplot is a DHTML-based AJAXy widget for plotting time series and overlay time-based events over them.

You can populate Timeplot with data by pointing it to an space or comma separated file. Timeplot also supports Timeline's XML format, meaning that you can reuse the same data file of your Timeline and overlay them over a time series plot.

Example

ZKCompRef Timeplot.png

<zk>
	<div width="1200px">
		New Legal Permanent Residents in the U.S. (per year) vs. U.S.
		History
		<zscript>
			import org.zkforge.timeplot.geometry.*; 
			import org.zkforge.timeplot.data.*;
			import org.zkforge.timeplot.operator.*;
			import org.zkforge.timeline.data.OccurEvent;
			import org.zkoss.zul.*;
			PlotDataSource pds=new PlotDataSource();
			pds.setDataSourceUri("misc/immigration.txt");
			pds.setSeparator(" ");
			ValueGeometry vg=new DefaultValueGeometry();
			vg.setGridColor("#000000");
			TimeGeometry tg=new DefaultTimeGeometry();
			tg.setAxisLabelsPlacement("bottom");
		</zscript>
		<timeplot width="1000px" height="300px">
			<plotinfo id="plot 1" plotDataSource="&#36;{pds}"
				dotColor="#000000" showValues="true" lineColor="#008bb6"
				valueGeometry="&#36;{vg}" timeGeometry="&#36;{tg}"
				eventSourceUri="misc/us_history.xml" />
		</timeplot>
	</div>
</zk>

immigration.txt

1820 8385
1821 9127
1822 6911
1823 6354
1824 7912
1825 10199
1826 10837
1827 18875
1828 27382
1829 22520
1830 23322

us_history.xml

<?xml version="1.0" encoding="UTF-8"?>
<data>
    <event start="Jan 01 1849 00:00:00 GMT" title="California Gold Rush" link="http://en.wikipedia.org/wiki/California_Gold_Rush"></event>
    <event start="Apr 12 1861 00:00:00 GMT" end="Apr 09 1865 00:00:00 GMT" title="American Civil War" link="http://en.wikipedia.org/wiki/American_Civil_War"></event>
    <event start="Aug 03 1882 00:00:00 GMT" title="Immigration Act of 1882" link="http://en.wikipedia.org/wiki/1882_Immigration_Act">The U.S. Congress passes a new Immigration Act that stated that a 50 cents tax would be levied on all aliens landing at United States ports. The money collected was to be used to defray the expenses of regulating immigration and for the care of immigrants after landing. The legislation also gave powers to the authorities to deny entry to "convicts (except those convicted of political offences), lunatics, idiots and persons likely to become public charges".</event>
    <event start="Apr 25 1898 00:00:00 GMT" title="Spanish-American War" link="http://en.wikipedia.org/wiki/Spanish-American_War"></event>
    <event start="Jul 28 1914 00:00:00 GMT" end="Nov 11 1918 00:00:00 GMT" title="World War I" link="http://en.wikipedia.org/wiki/World_war_1"></event>
    <event start="Jan 01 1924 00:00:00 GMT" title="Immigration Act of 1924" link="http://en.wikipedia.org/wiki/1924_Immigration_Act">The Immigration Act of 1924, which included the National Origins Act, Asian Exclusion Act or the Johnson-Reed Act, was a United States federal law that limited the number of immigrants who could be admitted from any country to 2% of the number of people from that country who were already living in the United States in 1890, according to the Census of 1890. It excluded immigration to the US of Asians. It superseded the 1921 Emergency Quota Act. The law was aimed at further restricting the Southern and Eastern Europeans who had begun to enter the country in large numbers beginning in the 1890s, as well as East Asians and Asian Indians, who were prohibited from immigrating entirely. It set no limits on immigration from Latin America.</event>
    <event start="Oct 29 1929 00:00:00 GMT" title="Black Tuesday" link=""></event>
    <event start="Jan 01 1933 00:00:00 GMT" end="Jan 01 1938 00:00:00 GMT" title="New Deal" link="http://en.wikipedia.org/wiki/New_Deal"></event>
    <event start="Sep 01 1939 00:00:00 GMT" end="Sep 02 1945 00:00:00 GMT" title="World War II" link="http://en.wikipedia.org/wiki/World_war_2"></event>
    <event start="Jun 25 1950 00:00:00 GMT" end="Jul 27 1953 00:00:00 GMT" title="Korean War" link="http://en.wikipedia.org/wiki/Korean_War"></event>
    <event start="Aug 02 1964 00:00:00 GMT" end="Apr 30 1975 00:00:00 GMT" title="Vietnam War" link="http://en.wikipedia.org/wiki/Vietnam_War"></event>
    <event start="Jul 21 1969 00:00:00 GMT" title="Man on the Moon">Neil Armstrong becomes the first person to walk on the Moon as the commander of the American mission Apollo 11.</event>
    <event start="Jan 01 1980 00:00:00 GMT" title="Refugee Act">The Refugee Act is a 1980 United States federal law that reformed United States immigration law and admitted refugees on systematic basis for humanitarian reasons. A 1985 ceiling of 70,000 refugees, with 270,000 immigrants total and 20,000 from any one country, was established.</event>
    <event start="Nov 06 1986 00:00:00 GMT" title="Immigration Reform and Control Act of 1986" link="http://en.wikipedia.org/wiki/Immigration_Reform_and_Control_Act_of_1986">The Act made it illegal to knowingly hire or recruit illegal immigrants, required employers to attest to their employees' immigration status, and granted amnesty to illegal immigrants who entered the United States before January 1, 1982 and had resided there continuously.</event>
    <event start="Nov 29 1990 00:00:00 GMT" title="Immigration Act of 1990" link="http://en.wikipedia.org/wiki/Immigration_Act_of_1990"></event>
    <event start="Sep 30 1996 00:00:00 GMT" title="Illegal Immigration Reform and Immigrant Responsibility Act of 1996" link="http://en.wikipedia.org/wiki/Illegal_Immigration_Reform_and_Immigrant_Responsibility_Act_of_1996"></event>
    <event start="Sep 11 2001 00:00:00 GMT" title="Attack at the World Trade Center" link="http://en.wikipedia.org/wiki/Vietnam_War"></event>
</data>

Supported Events

Name
Event Type
None None

Supported Children

* Plotinfo


Use Cases

Version Description Example Location
3.6 Smalltalk: Using Timeplot component-Part I Using Timeplot component-Part I
3.6 Smalltalk: Using Timeplot component-Part II Using Timeplot component-Part II

Version History

Last Update : 2022/03/22


Version Date Content
  July, 2014 Deprecate this component, please use ZK Charts instead



Last Update : 2022/03/22

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.